﻿function Bgm() {
    var bgmArray = new Array();
    this.play = function (audio, arg) {
        this.stop();
        bgmArray.push(audio);
        audio.play();
    }
    this.stop = function (arg) {
        if (bgmArray.length > 0)
            bgmArray[bgmArray.length - 1].pause();
    }
}
function Voice() {
    var voiceArray = new Array();
    this.play = function (audio, arg) {
        this.stop();
        voiceArray.push(audio);
        audio.play();
    }
    this.stop = function () {
        if (voiceArray.length > 0)
            voiceArray[voiceArray.length - 1].pause();
    }
}